<div class="alert alert-success"><span class="glyphicon glyphicon-info-sign"></span> 用户第一次关注时自动回复的消息</div>
<form action="" class="form-horizontal" role="form">
	<div class="form-group">
	    <label class="col-sm-2 control-label">自动回复类型</label>
	    <div class="col-sm-2">
	    	<select class="form-control" id="type-select" name="type" datatype="*">{$reply.typeOptions}</select>
	    </div>
	</div>
	
	<!-- 文本 -->
	<div class="form-group subscribeReply-txt">
		<label class="col-sm-2 control-label">自动回复内容</label>
		<div class="col-sm-4">
			<textarea class="form-control" name="text" rows="5" id="txtContent">{$reply.text}</textarea>
		</div>
	</div>
	
	<!-- 图文 -->
	<div class="form-group subscribeReply-img-txt">
		<label class="col-sm-2 control-label">自动回复内容</label>
		<div class="col-sm-5">
			<div id="news-result">
				<ul class="news-edit-lists">
				</ul>
			</div>
		</div>
	</div>
	
	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
			<input type="hidden" name="id" value="{$reply.id}"/>
			<input type="hidden" name="news" id="news-id" value="" />
			<button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/subscribePost">保存更改</button>
		</div>
	</div>
</form>

<!-- 图文素材列表 -->
<section id="news">
	<ul class="news-lists" id="news-lists"></ul>
</section>

<script type="text/javascript">
	var news_data = {$newsJSON};
</script>
<script type="text/javascript" src="__PUBLIC__/Style/My/Default/js/getNewsLists.js"></script>
<script type="text/javascript">
	$(function(){
		var type = $("#type-select option:selected").val();
		if(type == "text"){
			$(".subscribeReply-img-txt").hide();
			$(".subscribeReply-txt").show();
		}else if(type == "news"){
			$("#news").show();
			$(".subscribeReply-txt").hide();
			$(".subscribeReply-img-txt").show();
			$MoveTools.init({'listUrl': "__CONTROLLER__/getNewsListPost/p/"});
		}
		$("#type-select").on("change", function(){
			var sel = $(this).val();
			if(sel == "text"){
				$(".subscribeReply-img-txt").hide();
				$(".subscribeReply-txt").show();
				$("#news").hide();
				$("#news-lists").html("");
			}else if(sel == "news"){
				$("#news").show();
				$(".subscribeReply-txt").hide();
				$(".subscribeReply-img-txt").show();
				$MoveTools.init({'listUrl': "__CONTROLLER__/getNewsListPost/p/"});
			}
		});

	});
</script>